package testGroovy

import java.util.regex.Matcher
import java.util.regex.Pattern

Pattern p = Pattern.compile("b*g");
Matcher m = p.matcher("bbbbbbg");
boolean b = m.matches();
System.out.println(b);
System.out.println(m.group());
System.out.println("bbbbbbg".substring(m.start(), m.end()));

def msg = "bbbbbbg" =~ /b*g/
println msg[0]